﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using WmsApp.Lookup;

namespace WmsApp.Window
{
    public partial class FormConfirmPay : DevExpress.XtraEditors.XtraForm
    {
        public FormConfirmPay()
        {
            InitializeComponent();
            this.dateEditPayDate.EditValue = DateTime.Now.Date;
            if(GlobalClass.RunTimeMode)
            {
                LookupBind.BindingLookUpEditPayType(this.lookUpEditPayTypeCode3,this.textEditPayTypeName3);
            }
        }

        public DateTime? InOutDate { get; private set; }
        public string PayTypeCode { get; private set; }
        public string PayTypeName { get; private set; }

        private void CmdOk_Click(object sender, EventArgs e)
        {
            if( this.dateEditPayDate.EditValue == null)
            {
                XtraMessageBox.Show("请输入日期", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if( this.lookUpEditPayTypeCode3.EditValue == null)
            {
                XtraMessageBox.Show("请选择付款类型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            InOutDate = (DateTime?)this.dateEditPayDate.EditValue;
            this.PayTypeCode = (String)this.lookUpEditPayTypeCode3.EditValue;
            this.PayTypeName = textEditPayTypeName3.Text;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult =System.Windows.Forms.DialogResult.Cancel;
        }
    
    }
}